function [aligned_x, aligned_y]   =   reverse_shape_transform(x, y, rot, trans)
    n = sum(rot.^2,2);
    rot(:,2)    =   -rot(:,2);  rot =   rot./repmat(n,1,size(rot,2));
    ntrans  =   trans;
    ntrans(:,1)  =   trans(:,1).*rot(:,1) - trans(:,2).*rot(:,2);
    ntrans(:,2)  =   trans(:,1).*rot(:,2) + trans(:,2).*rot(:,1);
    trans   =   - ntrans;
    [aligned_x, aligned_y]  =   shape_transform(x, y, rot, trans);
end
